<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>文件测试</title>
		<script src="jquery.js"></script>
		<style>
			img,video,audio{
				width: 200px;
				height: 200px;
				display:inline-block
			}
		</style>
	</head>
	<body>
		<div>
			<img id="img" />
			<label>
				相册选取
				<!--只接收一个accept类型-->
				<!--capture会影响isCapture-->
				<!--！isCapture则可以使用handleIntent-->
				<input type="file"  accept="image/*" onchange="handleFiles('#img',this.files)"/>
			</label>
		</div>
		<div>
			<video id="video" controls="controls"></video>
			<label>
				相册选取jpeg,png
				<input type="file" capture="camcorder"   accept="video/*"  onchange="handleFiles('#video',this.files)"/>
			</label>
		</div>
		<div>
			<audio id="audio"  controls="controls"></audio>
			<label>
				相册选取jpeg,png
				<input type="file" capture="microphone"  accept="audio/*"  onchange="handleFiles('#audio',this.files)"/>
			</label>
		</div>

		<div>
			<label>
				普通文件
				<input type="file" capture="microphone"  accept="*/*"/>
			</label>
		</div>
	</body>
	<script>

		function handleFiles(img,files){
			var src=URL.createObjectURL(files[0])
			console.log(src)
			$(img).attr('src',src);
		}
	</script>

</html>
